<include file="Public:header"/>
<a href="{:U('Rbac/user')}">返回</a>
<br/>
<div class="span">
    <table>
        <tr>
            <td>{$user.id}</td>
        </tr>
        <tr>
            <td>{$user.name}</td>
        </tr>
        <tr>
            <td>{$user.status}</td>
        </tr>
        <tr>
            <td>{$user.email}</td>
        </tr>
        <tr>
            <td>{$user.reg_time}</td>
        </tr>
        <tr>
            <td>{$user.reg_ip}</td>
        </tr>
        <tr>
            <td>{$user.last_login_time}</td>
        </tr>
        <tr>
            <td>{$user.last_login_ip}</td>
        </tr>
        <tr>
            <td>{$user.login_count}</td>
        </tr>
    </table>
</div>
<div class="span">
    <table>
        <tr>
            <td colspan="3">用户角色</td>
        </tr>
        <foreach name="userRoles" item="role">
            <tr>
                <td>
                    {$role.role_id}
                </td>
                <td>
                    {$role.role_name}
                </td>
                <td>
                    {$role.role_remark}
                </td>
            </tr>
        </foreach>
    </table>
</div>
<div class="span">

    <table>
        <tr>
            <td colspan="3">用户不在角色</td>
        </tr>
        <foreach name="otherRoles" item="role">
            <tr>
                <td>
                    {$role.id}
                </td>
                <td>
                    {$role.name}
                </td>
                <td>
                    {$role.remark}
                </td>
            </tr>
        </foreach>
    </table>
</div>
<div class="span">
    <form action="" method="post">
        <table>
            <tr>
                <td colspan="4">管理角色</td>
            </tr>
            <foreach name="userRoles" item="role">
                <tr>
                    <td>
                        <input type="checkbox" name="role[]" value="{$role.role_id}" checked="checked"/>
                    </td>
                    <td>
                        {$role.role_id}
                    </td>
                    <td>
                        {$role.role_name}
                    </td>
                    <td>
                        {$role.role_remark}
                    </td>
                </tr>
            </foreach>
            <foreach name="otherRoles" item="role">
                <tr>
                    <td>
                        <input type="checkbox" name="roles[]" value="{$role.id}"/>
                    </td>
                    <td>
                        {$role.id}
                    </td>
                    <td>
                        {$role.name}
                    </td>
                    <td>
                        {$role.remark}
                    </td>
                </tr>
            </foreach>
            <tr>
                <td colspan="4">
                    <input type="submit" name="提交"/>
                </td>
            </tr>
        </table>
    </form>
</div>
<include file="Public:footer"/>